package br.univas.vperiod.jowey.entities;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="player_job")
public class PlayerJob implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2558004985805381739L;

	@Id
	@GeneratedValue
	@Column(name="idplayer_job",nullable=false)
	private long idPlayerJob;
	
	@OneToMany(fetch=FetchType.LAZY,mappedBy="playerJob",targetEntity=PlayerReport.class)
	private Set<PlayerReport> playerReports;
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="idPlayer")
	private Player player;
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="idProject")
	private Project project;
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="idActivity")
	private Activity activity;
	
	private String status;
	
	public long getIdPlayerJob() {
		return idPlayerJob;
	}

	public void setIdPlayerJob(long idPlayerJob) {
		this.idPlayerJob = idPlayerJob;
	}

	public Set<PlayerReport> getPlayerReports() {
		return playerReports;
	}

	public void setPlayerReports(Set<PlayerReport> playerReports) {
		this.playerReports = playerReports;
	}

	public Player getPlayer() {
		return player;
	}
	
	public void setPlayer(Player player) {
		this.player = player;
	}

	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	public Activity getActivity() {
		return activity;
	}

	public void setActivity(Activity activity) {
		this.activity = activity;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
}
